package micro.beauty.common.mvc.config;

import micro.beauty.common.mvc.filter.LoggingFilter;
import micro.beauty.common.mvc.properties.RestLoggerProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(RestLoggerProperties.class)
public class RestPrintLogConfig {

    @Bean
    public LoggingFilter loggingFilter(RestLoggerProperties restLoggerProperties) {
        return new LoggingFilter().setEnabledLogger(restLoggerProperties.isEnabled() ? true : false);
    }

}
